fid=fopen('results1.doc','r');
avgreward1=fscanf(fid,'%e',[1,inf]);
[a,b]=size(avgreward1);
number=max(a,b);
for i=1:number
x1(i)=i;
end
string1='RL';
string2='Belobaba';
string3='Ryzin & McGill';
fclose(fid);
fid=fopen('results2.doc','r');
avgreward2=fscanf(fid,'%e',[1,inf]);
[a,b]=size(avgreward2);
number=max(a,b);
for i=1:number
x2(i)=i;
end
fclose(fid);
fid=fopen('results3.doc','r');
avgreward3=fscanf(fid,'%e',[1,inf]);
[a,b]=size(avgreward3);
number=max(a,b);
for i=1:number
x3(i)=i;
end
plot(x1,avgreward1,'-',x2,avgreward2,':',x3,avgreward3,'--');
legend(string1,string2,string3);
xlabel('Number of Iterations in hundreds');
ylabel('Average Reward');
title('Comparison of performance of RL VS the heuristics');
